﻿@{
    ViewBag.Title = "Index";
}
<script src="~/Content/js/Hselect.js"></script>
@this.Partial("Index_js")

@this.RefStyle("~/Content/webuploader/webuploader.css")
@this.RefScript("~/Content/webuploader/webuploader.js")
<style type="text/css">
    .img_thum {
        max-width: 100px;
    }
</style>

<div style="width:100%;">
    <div class="topPanel">
        <div class="toolbar">
            <a class="a-btn-refresh" onclick="$ace.reload()"></a>
            <button class="a-btn-edit" data-bind="click:edit,disable:!dataTable.selectedModel()">修改</button>
            <button class="a-btn-add" data-bind="click:add">添加</button>
            <button class="a-btn-delete" data-bind="click:del,disable:!dataTable.selectedModel()">删除</button>
            <button   class="a-btn-info" onclick="window.location.href = '/Wiki/Pro_Sort/Index';">返回上级</button>
        </div>
        <div class="search">
            <table class="form-table" style="width:400px;">
                <tr>
                    <td>
                        <input type="text" class="a-control" placeholder="请输入要查询关键字" style="width: 200px;" data-bind="value:searchModel().keyword">
                    </td>
                    <td>
                        <button type="button" class="a-btn-search" data-bind="click:search"></button>
                    </td>
                </tr>
            </table>
        </div>
    </div>


    <div>
        <table class="table table-hover" data-bind="with:dataTable">
            <thead>
                <tr>
                    <th style="width:20px;"></th>
                    <th>编号</th>
                    <th>名称</th>
                    <th>图标</th>
                    <th>图片</th>
                    <th>排序</th>
                </tr>
            </thead>
            <tbody data-bind="foreach:models">
                <tr data-bind="click:$parent.selectRow">
                    <td data-bind="text:$parent.getOrdinal($index())"></td>
                    <td data-bind="text:Id"></td>
                    <td>
                        <a data-bind="text:Title,attr:{href:'@Url.Content("~/Wiki/Pro_Sort/Index?Pid=")' + Id()}"></a>
                    </td>
                    <td data-bind="text:Icon"></td>
                    <td data-bind="text:ImageUrl"></td>
                    <td data-bind="text:SortCode"></td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
<dialogbox data-bind="with:dialog">
    <form id="form1">
        <table class="form-table">
            <tr>
                <td class="form-title">名称</td>
                <td class="form-value">
                    <input name="Title" type="text" class="a-control required" placeholder="请输入名称" data-bind="value:model().Title" />
                </td>
            </tr>
            
            <tr>
                <td class="form-title">分类描述</td>
                <td class="form-value">
                    <input name="Summary" type="text" class="a-control required" placeholder="请输入分类描述" data-bind="value:model().Summary" />
                </td>
            </tr>
            <tr>
                <td class="form-title">分类图片</td>
                <td class="form-value">
                    <div id="uploader" class="wu-example" style="z-index:99999;">
                        <div class="btns">
                            <div id="picker">选择文件</div>
                        </div>
                        <div id="thelist" class="uploader-list"></div>
                    </div>
                    <input name="ImageUrl" id="ImageUrl" type="text" class="a-control" data-bind="value:model().ImageUrl" />
                </td>
            </tr>
            <tr>
                <td class="form-title">分类图标</td>
                <td class="form-value">
                    <input name="Icon" id="Icon" type="text" class="a-control required" placeholder="请配置分类图标" data-bind="value:model().Icon" />
                </td>
            </tr>
            <tr>
                <td class="form-title">序号</td>
                <td class="form-value">
                    <input name="SortCode" type="text" class="a-control required" placeholder="请输入序号" data-bind="value:model().SortCode" />
                </td>
            </tr>
            <tr>
                <td class="form-title">上级分类</td>
                <td class="form-value">
                    <select name="Pid" id="Pid" type="text" class="a-control required" data-bind="value:model().Pid"  >
                    </select>
                </td>
            </tr>


        </table>
    </form>
</dialogbox>
